import Vue from 'vue'
import App from './App'
import store from '@/store'
import router from '@/router'
import ElementUI from 'element-ui'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' // global css
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import '@/icons' // icon
import '@/permission' // permission control
if (process.env.NODE_ENV === 'production') {
  const {mockXHR} = require('../mock')
  mockXHR()
}
// 引入api的相关接口
import API from '@/api'
// 组件实例的原型的原型指向的是vue.prototype 任意组件可以使用API相关的接口
Vue.prototype.$API=API
// 三级连动全局组件
import CategorySelect from '@/components/CategorySelect'
Vue.component(CategorySelect.name,CategorySelect)
// set ElementUI lang to EN
Vue.use(ElementUI, {locale})
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)
Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
